//package com.wym.rbac.config;
//
////import com.wym.rbac.web.interceptor.CheckLoginInterceptor;
////import com.wym.rbac.web.interceptor.CheckPermissionInterceptor;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
///**
// * 配置拦截器
// */
//@Configuration
//public class WebConfig implements WebMvcConfigurer {
//
//    @Autowired
//    private CheckLoginInterceptor checkLoginInterceptor;
//
//    @Autowired
//    private CheckPermissionInterceptor checkPermissionInterceptor;
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        // 注册登录认证拦截器
//        registry.addInterceptor(checkLoginInterceptor)
//                .addPathPatterns("/**")  // 所有请求都会被拦截
//                .excludePathPatterns("/login", "/register", "/error", "/static/**"); // 排除不需要拦截的路径
//
//        // 注册权限认证拦截器
//        registry.addInterceptor(checkPermissionInterceptor)
//                .addPathPatterns("/**")  // 所有请求都会被拦截
//                .excludePathPatterns("/login", "/register", "/error", "/static/**"); // 排除不需要拦截的路径
//    }
//}
